Peak sampling of an AC voltage is usually implemented in digital way, which requires memories for data storage and digital processors for signal processing. If there is no digital element in the system, peak sampling is usually implemented by a diode and a capacitor. However, this simple solution is not accurate especially when the peak value of the AC voltage varies cycle by cycle.